<?php


class Member
{
    //删
    public  function del()
    {
        $id = input('get.id');
        $a = new \app\api\model\member();
        if (strpbors($id,',')!= false){
            $id = substr($id,0,strlen($id) -1);
        }
        return $a->where('member_id','in',$id)->delete();
    }
    public function sel()
{
    //查
    $page = input('get.page');
    $limit = input('get.limit');
    $keyword = input('get.keyword');
    $condition = array();
    if (!empty($keyword)) {
        $condition[] = ['member_email','like','%'.$keyword.'%'];
    }
    $a =new \app\api\model\member();
    $data = array();
    $data ['code'] =0;
    $data['msg'] ='';
    $datas = $a->where($condition)->page($page)->limit($limit)->select();
    //{{a:1},{b:2}}
    foreach ($datas as $item) {
        $item['add_time_name'] = date('Y-m-d H:i:s',$item[add_time]);
    }
    $data['data'] = $datas;
    header('content-type:application/json');
    echo json_encode($data);
    die();
}
}